<template>
  <div class="detail">
    <div class="top">
      <div class="topItem">
        <img :src="data.avatar" />
        <div class="price">{{data.price}}</div>
      </div>
      <div class="other">
       
        <div class="time">{{data.showTime}}</div>
        <div class>{{data.site.cityName}}{{data.site.name}}</div>
      </div>
      <div class="arist">
        <div class="artistItem"></div>
      </div>
    </div>
    <div id="center" ref="center" v-html="this.list" class="center"></div>
  </div>
</template>

<script>
import Vue from "vue";
import { mapState, mapActions } from "vuex";
import { detailApi } from "@api/request.js";
export default {
  name: "detail",
  data() {
    return {
      activityId: "",
      list: [],
      data: [],
      arist: [],
      music: [],
      album: []
    };
  },
  //  props:["activityId"],
  methods: {
    ...mapActions({
      getAsyncDetail: "getAsyncDetail"
    }),
    appendData(data) {}
  },
  created() {
    this.activityId = this.$route.params.activityId;
    console.log(this.list);

    // this.appendDate(this.list)
  },

  watch: {
    activityId: {
      async handler(newVal) {
        if (!newVal) {
          newVal = localStorage.getItem("activityId");
        }
        this.getAsyncDetail(newVal);
        let data = await detailApi(newVal);
        if (data.result) {
          this.list = data.result.activityVo.document;
          this.data = data.result.activityVo;
          console.log(this.data);
          this.arist = data.result.activityVo.userInfos;
          console.log(this.arist);
          this.music = data.result.activityVo.music;
          console.log(this.music);
        }
      },
      immediate: true
    }
  }
};
</script>
<style lang="scss">
.detail{
  width: 100%
}
.top {
  width: 7.5rem;
  height: 6rem;
  background: (top, rgba(255, 255, 255, 0.8) 20%, rgb(255, 255, 255));
  .topItem {
    img {
      width: 3rem;
      height: 4rem;
    }
  }
}
.center img{
  width: 400px;
  height: 400px;
}
</style>
